import { http } from "@/utils/http";

interface CateList {
  code: number;
  message: string;
  data?: any;
}

/** 获取商品分类列表*/
export const getCateList = (data?: object) => {
  return http.request<CateList>("post", "/api/goods-category/list", { data });
};
/** 获取商品分类详情*/
export const getCateDetail = (data?: object) => {
  return http.request<CateList>("post", "/api/goods-category/detail", { data });
};
/** 添加商品分类*/
export const addCate = (data?: object) => {
  return http.request<CateList>("post", "/api/goods-category/add", { data });
};
/** 修改商品分类*/
export const updateCate = (data?: object) => {
  return http.request<CateList>("post", "/api/goods-category/update", { data });
};
/** 删除商品分类*/
export const delCate = (data?: object) => {
  return http.request<CateList>("post", "/api/goods-category/delete", { data });
};
/** 获取商品分类树形结构*/
export const getCateTree = (data?: object) => {
  return http.request<CateList>("get", "/api/goods-category/tree", { data });
};
